package com.lsk.controller;

import com.lsk.internalcommon.DTO.Car;
import com.lsk.internalcommon.DTO.DriverCarBindingRelationship;
import com.lsk.internalcommon.DTO.DriverUser;
import com.lsk.internalcommon.DTO.ResponseResult;
import com.lsk.service.DriverUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
public class DriverUserController {
    @Autowired
    private DriverUserService driverUserService;

    @PostMapping("/driver-user")
    public ResponseResult addDriverUser(@RequestBody DriverUser driverUser){
        log.info("api-boss调用service-Driver_user服务addDriverUser功能");
        return driverUserService.addDriverUser(driverUser);
    }

    @PutMapping("/driver-user")
    public ResponseResult updateDriverUser(@RequestBody DriverUser driverUser){
        log.info("api-boss调用service-Driver_user服务updateDriverUser功能");
        return driverUserService.updateDriverUser(driverUser);
    }

    @PostMapping("/car")
    public ResponseResult addCar(@RequestBody Car car){
        return driverUserService.addCar(car);
    }

    @PostMapping("/DriverCarBindingRelationship/bind")
    public ResponseResult bind(@RequestBody DriverCarBindingRelationship relationship){
        return driverUserService.bind(relationship);
    }

    @PostMapping("/DriverCarBindingRelationship/unbind")
    public ResponseResult unbind(@RequestBody DriverCarBindingRelationship relationship){
        return driverUserService.unbind(relationship);
    }
}
